Imports Aricie.DNN.Caching
Imports QuickGraph

Namespace Aricie.DNN.Caching.Analysis.Graphs
    Public Class CacheGraphImageHandler
        Inherits GraphImageHandler(Of DistributedCachingNode, DistributedCachingEdge)


        Public Overrides Function GetCommand(ByVal context As System.Web.HttpContext) As MsaglLayoutCommand(Of DistributedCachingNode, DistributedCachingEdge)
            Return New CacheGraphCommand
        End Function

        Public Overrides Function GetGraph(ByVal context As System.Web.HttpContext) As QuickGraph.IEdgeListGraph(Of DistributedCachingNode, DistributedCachingEdge)
            Dim display As String = context.Request.QueryString("display")
            If Not String.IsNullOrEmpty(display) Then
                Select Case display.ToLower
                    Case "statisticsgraph"
                        Return DistributedCachingBusinessController.LoadStatistics().StatisticsGraph
                    Case "analysisgraph"
                        Return DistributedCachingBusinessController.LoadAnalysis().AnalysisGraph
                End Select
            End If
            Return New DistributedCachingGraph
        End Function
    End Class
End Namespace